<?php

declare(strict_types=1);

namespace app\store\controller\tools;

use app\store\controller\Controller;
use think\App;
use think\response\Json;
use app\store\service\tools\CodeSearch as CodeSearchService;

class CodeSearch extends Controller
{
    private $codeSearchService;
    public function __construct(App $app,CodeSearchService $codeSearchService)
    {
        parent::__construct($app);
        $this->codeSearchService = $codeSearchService;
    }

    //查询记录
    public function list():Json
    {
        $params = $this->request->get();
        $this->validate(
            $params,
            [
                'page' => 'integer',
                'limit' => 'integer',
            ]
        );
        $list = $this->codeSearchService->getList($params);
        return  $this->renderSuccess(compact('list'));
    }





}